<template>
	<view class="content">
		<view class="list">
			<text class="text">头像</text>
			<view class="info">
				<image :src="data.avatar" mode=""></image>
				<!-- <text>></text> -->
			</view>
		</view>
		<view class="list1">
			<text class="text">昵称</text>
			<view class="info">
				<text class="text1">{{ data.user_nickname }}</text>
				<!-- <text class="text">></text> -->
			</view>
		</view>
		<navigator url="../bangding/bangding" v-if="!data.mobile">
			<view class="list2">
				<text class="text">手机号</text>
				<view class="info" v-if="!data.mobile">暂未绑定手机号码</view>
				<view class="info" v-else>{{ data.mobile }}</view>
			</view>
		</navigator>
		<navigator url="../mima/mima" v-else>
			<view class="list2">
				<text class="text">手机号</text>
				<view class="info" v-if="!data.mobile">暂未绑定手机号码</view>
				<view class="info" v-else>{{ data.mobile }}</view>
			</view>
		</navigator>
		<!-- <view class="list2">
			<text class="text">身份认证</text>
			<view class="info1">></view>
		</view> -->
		<!-- <view class="list2">
			<text class="text">检查更新V2.25</text>
			<view class="info1">></view>
		</view>
		<view class="list2">
			<text class="text">查看协议</text>
			<view class="info1">></view>
		</view>
		<view class="sgnOut">
			退出登录
		</view> -->
	</view>
</template>

<script>
export default {
	data() {
		return {
			data: {
				type: ''
			}
		};
	},
	onLoad() {
		this.personalCtr();
	},
	onShow() {},
	methods: {
		//个人中心（用户基础数据）
		async personalCtr() {
			const res = await this.$u.post(
				'/api/User/userinfo',
				{},
				{
					'XX-Token': uni.getStorageSync('token'),
					'XX-Device-Type': 'wxapp'
				}
			);
			console.log('个人中心 >>  ', res);
			this.data = res.data;
			if (!res.data.mobile) {
				uni.setStorageSync("type",1)
			}else{
				uni.setStorageSync("type",2)
			}
		}
	}
};
</script>

<style lang="scss">
.content {
	padding: 30rpx;
	.list {
		width: 690rpx;
		height: 178rpx;
		background: #ffffff;
		border-radius: 10rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 22rpx;
		margin-bottom: 20rpx;
		.text {
			font-size: 32rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #333333;
		}
		.info {
			display: flex;
			align-items: center;

			image {
				width: 120rpx;
				height: 120rpx;
				// 	margin-right: 22rpx;
			}
			text {
				color: #c0c0c0;
			}
		}
	}
	.list1 {
		width: 690rpx;
		height: 90rpx;
		background: #ffffff;
		border-radius: 10rpx;
		margin-bottom: 20rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 22rpx;
		.text {
			font-size: 32rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #333333;
		}
		.info {
			display: flex;
			align-items: center;

			image {
				width: 120rpx;
				height: 120rpx;
				margin-right: 22rpx;
			}
			.text {
				color: #c0c0c0;
				margin-left: 21rpx;
			}
			.text1 {
				font-size: 32rpx;
				font-family: SourceHanSansCN;
				font-weight: 400;
				color: #333333;
			}
		}
	}
	.list2 {
		width: 690rpx;
		height: 90rpx;
		background: #ffffff;
		border-radius: 10rpx;
		margin-bottom: 20rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 22rpx;
		.text {
			font-size: 32rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #333333;
		}
		.info {
			font-size: 32rpx;
			font-family: SourceHanSansCN;
			font-weight: 400;
			color: #333333;
		}
		.info1 {
			color: #c0c0c0;
		}
	}

	.sgnOut {
		width: 690rpx;
		height: 90rpx;
		line-height: 90rpx;
		text-align: center;
		background: #ffffff;
		border-radius: 10rpx;
		margin-top: 64rpx;

		font-size: 32rpx;
		font-family: SourceHanSansCN;
		font-weight: 400;
		color: #333333;
	}
}
</style>
